<?php
namespace imtalk;

class WebIM {

    protected $setting = [
        'reactor_num' => 1, //reactor线程数,一般设置为CPU核数的1-4倍
        'worker_num' => 2, //worker进程数量，一般设置为CPU核数的1-4倍
        'max_request' => 1000, //worker进程处理多少任务数之后，自动销毁
        'log_file' => RUNTIME_PATH . 'swoole/webim.log'
    ];

    public function __construct() {
        $web_socket_server = new \Swoole\Websocket\Server('0.0.0.0', 9502);
        $web_socket_server->set($this->setting);
        $web_socket_server->on($event_name, $callback);
        $web_socket_server->start();
    }
    
    public function open($param) {
        
    }

}
